// pending 状态，不会触发 then 和 catch
// fulfilled 状态，会触发后续的 then 回调函数
// rejected 状态，会出发后续的 catch 回调函数
const p1 = new Promise((resolve, reject)=>{})
console.log('p1:', p1) // pending

const p2 = new Promise((resolve, reject)=>{
  setTimeout(()=>{
    resolve()
  })
})
console.log('p2:', p2) // pending fulfilled
setTimeout(()=>console.log('p2-setTimeout:', p2)) // fulfilled

const p3 = new Promise((resolve, reject)=>{
  setTimeout(()=>{
    reject()
  })
})
console.log('p3:', p3) // undefined
setTimeout(()=>console.log('p3-setTimeout:', p3)) // reject